<template>
  <div>
    <el-input v-model="search" placeholder="请输入医师姓名" style="width: 300px;height: 40px;margin:10px 5px" clearable></el-input>
    <el-button type="primary" style="width:50px;height: 40px;margin:5px 5px" @click="load">查询</el-button>
    <el-table :data= "tableData" stripe border style="width: 100%">
      <el-table-column prop="doctorid" label="医师ID"  sortable width="200px" />
      <el-table-column prop="doctorname" label="医师姓名"  width="200px" />
      <el-table-column prop="historydate" label="日期" sortable width="200px" for/>
      <el-table-column prop="lastingtime" label="持续时间" width="200px" />
      <el-table-column prop="chief" label="主诉" width="200px" >
          <el-link @click="checkChief">查看主诉</el-link>
      </el-table-column  >
      <el-table-column prop="historyrecord" label="既往病史"  width="200px">
          <el-link @click="checkHistoryrecord">既往病史</el-link>
      </el-table-column  >
      <el-table-column prop="diagnosis" label="是否已诊断" width="200px" />
      <el-table-column prop="operations" label="操作" fixed="right" width="340px">
        <template #default="scope">
          <el-button @click="compare(scope.row)" size="small" type="primary">对比病历</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
        style="vertical-align:bottom;padding-left: 400px;margin: 10px 10px"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[5,10,20]"
        :page-size="pageSize"
        layout="total,sizes,prev,pager,next,jumper"
        :total="total">
    </el-pagination>
    <el-dialog title="主诉" v-model="dialogVisible1" width="30%">
        <span>这里是主诉</span>
        <template #footer>
        <span class = "dialog-footer">
          <el-button @click="dialogVisible1 = false">好的</el-button>
        </span>
      </template>
    </el-dialog>
    <el-dialog title="既往病史" v-model="dialogVisible2" width="30%">
        <span>既往病史</span>
        <template #footer>
        <span class = "dialog-footer">
          <el-button @click="dialogVisible2 = false">好的</el-button>
        </span>
      </template>
    </el-dialog>
 </div>
</template>
<script>
import request from "@/utils/request.js";


export default {
  name: 'MyrecordView',
  components: {},
  data(){
    return{
      form: {
      },
      dialogVisible1: false,
      dialogVisible2: false,
      search:'',
      total:0,
      currentPage:1,
      pageSize:10,
      tableData :[],
    }
  },
  created() {

  },
  methods:{
    load() {

    },
    compare(){

    },
    checkChief(){
          this.dialogVisible1 = true
    },
    checkHistoryrecord(){
          this.dialogVisible2 = false
    },
    handleSizeChange(pageSize){
       this.pageSize = pageSize
       //this.load()
    },
    handleCurrentChange(pageNum){
       this.currentPage = pageNum
       //this.load()
    }
  }
}
</script>
